package com.imooc.o2o.dto;

import lombok.Data;

/**
 * @author 徐老板
 * @date 2020/1/21   22:18
 */
@Data
public class Result<T> {
    private boolean success;
    private T data;
    private String errMsg;
    private int errCode;

    public Result() {
    }
//成功时的构造器
    public Result(boolean success, T data) {
        this.success = success;
        this.data = data;
    }
//错误时的构造器


    public Result(boolean success, String errMsg, int errCode) {
        this.success = success;
        this.errMsg = errMsg;
        this.errCode = errCode;
    }

    public boolean isSuccess(){
        return success;
    }

}
